import 'package:flutter/material.dart';
void main() {
  runApp(const MyApp());
}
class MyApp extends
StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: '个人名片',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const PersonalCardPage(),
    );
  }
}
class PersonalCardPage extends StatelessWidget {
  const PersonalCardPage({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('个人主页'),
      ),
      body: Container(
        color: Colors.grey[100],
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // 圆形头像
            CircleAvatar(
              backgroundImage: AssetImage('assets/images/yang_zhenguang.jpg'),
              radius: 75,
            ),
            const SizedBox(height: 20),
            // 姓名
            const Text(
              '杨振光',
              style: TextStyle(
                fontSize: 24,
                fontWeight: FontWeight.bold,
              ),
            ),
            const SizedBox(height: 10),
            // 个性签名
            const Text(
              '「信息工程学院」',
              style: TextStyle(
                fontSize: 16,
                color: Colors.grey,
              ),
              textAlign: TextAlign.center,
            ),
            const SizedBox(height: 30),
            // 可自由发挥的模块，这里添加一些社交信息示例
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                Column(
                  children: const [
                    Text(
                      '120',
                      style: TextStyle(
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    Text('关注'),
                  ],
                ),
                Column(
                  children: const [
                    Text(
                      '200',
                      style: TextStyle(
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    Text('粉丝'),
                  ],
                ),
                Column(
                  children: const [
                    Text(
                      '30',
                      style: TextStyle(
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    Text('作品'),
                  ],
                ),
              ],
            ),
            const SizedBox(height: 30),
            // 按钮示例
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                ElevatedButton(
                  onPressed: () {},
                  child: const Text('发消息'),
                ),
                const SizedBox(width: 20),
                ElevatedButton(
                  onPressed: () {},
                  child: const Text('关注'),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
